package controller.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import Bean.highlightBean;
import dao.highlightDao;

public class DBdeleteController extends AbstractCommandController {

	private highlightDao hldao;

	public void setHldao(highlightDao hldao) {
		this.hldao = hldao;
	}

	@Override
	protected ModelAndView handle(HttpServletRequest request,
			HttpServletResponse response, Object obj, BindException error)
			throws Exception {

		highlightBean bean = (highlightBean) obj;

		System.out.println("cont hlnum" + bean.getHlnum());

		ModelAndView mav = new ModelAndView();

		hldao.AdminDBdelete(bean);

		mav.setViewName("redirect:/AdminDBform.admin");

		return mav;
	}
}
